<!--
 * @Autor: dingxiaolin
 * @Date: 2021-06-02 14:33:43
 * @LastEditors: dingxiaolin
 * @LastEditTime: 2021-06-03 15:04:16
-->
<template>
  <div id="userLayout" :class="['user-layout-wrapper', device]">
    <div class="container">
      <div class="top">
        <div class="header">
          <a href="/">
            <img src="@/assets/120.png" class="logo" alt="logo" />
            <span class="title"> {{ project.product_sname }}</span>
          </a>
        </div>
        <div class="desc">
          {{ project.product_desc }}
        </div>
      </div>
      <slot name="login"></slot>
      <div class="footer">
        <div class="links">
          <!-- 技术支持：殷先生 电子邮箱：yinj@msy.cn 商户合作：王先生 联系电话：18939183977
          电子邮箱：wangr@msy.cn -->
        </div>
        <div class="copyright">
          Copyright &copy; {{ new Date().getFullYear() }} &nbsp;
          <strong>
            {{ project.company_name }}
            &nbsp;
            <a key="" title="" target="_blank" :href="project.company_web">
              {{ project.company_ename }}
            </a>
          </strong>
          <span>All Rights Reserved. </span>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import {
  defineComponent,
  PropType,
  reactive,
  toRefs,
  toRef,
  computed,
  nextTick,
  onMounted,
  onUnmounted
} from 'vue'
import { useRouter } from 'vue-router'
import project from '@/config/product.json'
import { mixinDevice } from '@/hooks'
export default defineComponent({
  name: 'companyInfo',
  components: {},
  props: {},
  emits: [],
  setup(props, ctx) {
    const router = useRouter()
    const state = reactive({
      project: project
    })
    const { device } = mixinDevice()
    onMounted(() => {
      document.body.classList.add('userLayout')
    })
    onUnmounted(() => {
      document.body.classList.remove('userLayout')
    })
    return {
      ...toRefs(state),
      device
    }
  }
})
</script>

<style lang="scss" scoped>
#userLayout.user-layout-wrapper {
  height: 100%;

  &.mobile {
    .container {
      .main {
        max-width: 368px;
        width: 98%;
      }
    }
  }

  .container {
    width: 100%;
    min-height: 100%;
    background-size: cover;
    position: relative;

    a {
      text-decoration: none;
    }

    .top {
      text-align: center;
      padding: 89px 0 15px 0;
      .header {
        height: 44px;
        line-height: 44px;

        .badge {
          position: absolute;
          display: inline-block;
          line-height: 1;
          vertical-align: middle;
          margin-left: -12px;
          margin-top: -10px;
          opacity: 0.8;
        }

        .logo {
          height: 44px;
          vertical-align: top;
          margin-right: 16px;
          border-style: none;
          border-radius: 3px;
        }

        .title {
          font-size: 33px;
          color: rgba(0, 0, 0, 0.85);
          font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
          font-weight: 600;
          position: relative;
          top: 2px;
        }
      }
      .desc {
        font-size: 18px;
        color: rgba(0, 0, 0, 0.45);
        margin-top: 12px;
        margin-bottom: 40px;
      }
    }

    .main {
      min-width: 260px;
      width: 368px;
      margin: 0 auto;
    }

    .footer {
      position: fixed;
      width: 100%;
      bottom: 10px;
      text-align: center;

      .links {
        color: rgba(0, 0, 0, 0.49);
        margin-bottom: 8px;
        font-size: 14px;
        a {
          color: rgba(0, 0, 0, 0.45);
          transition: all 0.3s;
          &:not(:last-child) {
            margin-right: 40px;
          }
        }
      }
      .copyright {
        color: rgba(0, 0, 0, 0.45);
        font-size: 14px;
      }
    }
  }
}
</style>
